home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / 1995.02 / 000130_dan@tesla.psych.nyu.edu_Wed Feb 22 14:48:51 1995.msg < prev    next >
Internet Message Format  |  1995-02-28  |  5KB

  1. Received: from TESLA.PSYCH.NYU.EDU by cs.umb.edu with SMTP id AA15723
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Wed, 22 Feb 1995 19:50:00 -0500
  3. Received: by tesla.psych.nyu.edu (920330.SGI/920502.SGI)
  4.     for tex-k@cs.umb.edu id AA01491; Wed, 22 Feb 95 19:48:51 -0500
  5. Date: Wed, 22 Feb 95 19:48:51 -0500
  6. From: dan@tesla.psych.nyu.edu (Dan Karron)
  7. Message-Id: <9502230048.AA01491@tesla.psych.nyu.edu>
  8. To: bug-gnu-utils@prep.ai.mit.edu, bob@gnu.ai.mit.edu, tex-k@cs.umb.edu,
  9.         kb@cs.bu.edu, geoff@itcorp.com, g.kuenning@ieee.org
  10. Subject: Shell script to intuit spooler available for testing
  11. Reply-To: karron@nyu.edu
  12.  
  13. Dear package writers;
  14.  
  15. Here is something to beat on that tries to intuit the spooler on your
  16. system.
  17.  
  18. The goal is to put something in autoconf that will set
  19. a ac_print_spooler var to something that has a reasonable
  20. chance of being correct.
  21.  
  22. I have only tested this so far on IRIX 4.05, and
  23. IRIX 5.2. Some systems have lpr running out of the
  24. box if you uncomment a few lines in /etc/printcap,
  25. others never worked since I had the systems.
  26.  
  27. This will need lots of testing. Please send me transcripts and
  28. thoughts.
  29.  
  30. Just because you have an executable somewhere does not mean
  31. it is installed. Perhaps sending a test print job
  32. and verifying it is on the queue, then killing it,
  33. would be as close as you can get to a comprehensive
  34. test. Lots of people (ME!) have only halfass installations 
  35. of lpr.
  36.  
  37. Comments welcome.
  38.  
  39. Note, I have not finished the results. Just need some
  40. strings from lpc status under various states.
  41.  
  42. Cheers!
  43.  
  44. Dan.
  45.  
  46. #! /bin/sh
  47. # This is a prototype script that tries to intuit
  48. # what print spooler you have running on your system.
  49. # It first scans for executables,  and then
  50. # if it finds them,  it checks the status of the spoolers.
  51. # For each spooler that has good status,  it leaves ac_lp_spooler
  52. # and ac_lpr_spooler with the full path of the spooler.
  53. # if Both work,  pick lp (my favorite),  else use the operable one.
  54.  
  55. # This needs extensive testing,  as I only have limited 
  56. # experience with lpr.
  57.  
  58. # please send the output and changes to karron@nyu.edu
  59. # Eventually,  I want to send this up to the autoconfig
  60. # maintainer for inclusion into autoconf.
  61.  
  62. # Note,  that I try to make messages that indicate the
  63. #  heuristic used to intuit the spooler,  instead of a checking.
  64. #  Also,  I make use of the Verbose variable.
  65.  
  66.  
  67. #clean up path components
  68.  
  69. ac_PATH_COMPONENTS=`echo ":$PATH:" | sed 's/:/ /g;s,//,/,g;s/  / /g'`
  70. ac_SPOOLERS_LIST="lp lpr"
  71. ac_SPOOLERS_STATUS_LIST="lpstat lpc"
  72. VERBOSE=1
  73.  
  74. MESSAGE=echo
  75.  
  76. for ac_j in $ac_SPOOLERS_LIST
  77. do
  78.     for ac_i in $ac_PATH_COMPONENTS
  79.     do
  80.     if test -x $ac_i/$ac_j
  81.     then
  82.         if test $VERBOSE = 1 ; then
  83.         echo found $ac_j at $ac_i/$ac_j
  84.         fi
  85.     eval ac_SPOOL_$ac_j=$ac_i/$ac_j
  86.     break
  87.     else
  88.         if test $VERBOSE = 1 ; then
  89.         echo "- \c"
  90.         fi
  91.     fi
  92.     done
  93. done
  94.  
  95. for ac_j in $ac_SPOOLERS_STATUS_LIST
  96. do
  97.     for ac_i in $ac_PATH_COMPONENTS
  98.     do
  99.     if test -x $ac_i/$ac_j
  100.     then
  101.         if test $VERBOSE = 1 ; then
  102.         echo found $ac_j at $ac_i/$ac_j
  103.         fi
  104.     eval ac_SPOOLER_STATUS_$ac_j=$ac_i/$ac_j
  105.     break
  106.     else
  107.         if test $VERBOSE = 1  ; then
  108.         echo "- \c"
  109.         fi
  110.     fi
  111.     done
  112. done
  113.  
  114. if test -n "$ac_SPOOL_lp"
  115. then
  116. $MESSAGE "\nchecking lp status with \"$ac_SPOOLER_STATUS_lpstat\""
  117.     if test -n "$ac_SPOOLER_STATUS_lpstat"
  118.     then
  119.     echo "\t$ac_SPOOLER_STATUS_lpstat says \c"
  120.     if test -x "$ac_SPOOLER_STATUS_lpstat"
  121.     then
  122.     ac_lpstat_results=`$ac_SPOOLER_STATUS_lpstat -r `
  123. #    echo "\"$ac_lpstat_results\"\n"
  124.         case $ac_lpstat_results in
  125.         "scheduler is running")
  126.         echo "lp ok"
  127.         break
  128.         ;;
  129.         "*")echo "unrecognized message from $ac_SPOOLER_STATUS_lpstat"
  130.         echo "\"$ac_lpstat_results\"\n"
  131.         ;;
  132.         esac
  133.     else
  134.     echo "unable to execute $ac_SPOOLER_STATUS_lp,  something is wrong"
  135.     exit 1
  136.     fi
  137.     fi
  138. else
  139. echo "no lp on this system"
  140. fi
  141.  
  142.  
  143. if test -n "$ac_SPOOL_lpr"
  144. then
  145. echo "\nchecking lpc with \"$ac_SPOOLER_STATUS_lpc\""
  146.     if test -x $ac_SPOOLER_STATUS_lpc
  147.     then
  148.     echo "\t$ac_SPOOLER_STATUS_lpc says \c"
  149.     ac_lpc_status=`$ac_SPOOLER_STATUS_lpc status`
  150.     echo " \"$ac_lpc_status\" \n"
  151.     case $ac_lpc_status in
  152.     *"no daemon present"*)echo "no lpr daemon present"
  153.     break;;
  154.     *)echo "unrecognized lpc message:"
  155.     echo "\"$ac_lpc_status\"\n"
  156.     ;;
  157.     esac
  158.     else
  159.     echo "unable to execute $ac_SPOOLER_STATUS_lpc,  something is wrong"
  160.     exit 1
  161.     fi
  162. else
  163. echo "no lpr on this system"
  164. fi
  165.  
  166. | karron@nyu.edu (e-mail alias)Dan Karron, Ph.D.,Research Assistant Professor|
  167. | Phone: 212 263 5210 Fax: 212 263 7190  New York University Medical Center  |
  168. | 560 First Avenue                       Digital Pager  <1>  212 397 9330    |
  169. | New York, New York 10016               <2> 10896   <3> <your-number-here>  |
  170.